package com.yehui.first;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.ApplicationContext;
import org.springframework.core.PriorityOrdered;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;

@Service
public class MyBeanPostProcessorAndPriorityOrdered implements BeanPostProcessor, PriorityOrdered {
    @Autowired
    private ApplicationContext applicationContext;

    @PostConstruct
    public void init(){
        System.out.println("print init()");
    }

    @Override
    public int getOrder() {
        return 0;
    }


    public void printApp(){
        System.out.println("pringt app:=="+applicationContext);
    }
}
